//registerHelper
// Register required Template7 helpers, before templates compilation
Template7.registerHelper('json_stringify', function (context) {
    return JSON.stringify(context);
});
Template7.registerHelper('selfplayingmethoddetailrecommend_format', function (recommend) {
    var result='';
    if(recommend){
        var recommendlist = recommend.split("\n");
        for(var i in recommendlist){
            result = result + "<li>"+ recommendlist[i] +"</li>";
        }
    }
    return result;
});
 // <div class="day">{{dayOfWeek date}}</div>

Template7.registerHelper('gendertext', function (gender) {
    var result;
    if(gender=="m"){
    	result = "男";
    }else{
    	result = "女";
    }
    return result;
});

Template7.registerHelper('formatprocess', function (process) {
    //进度条 0：无进度 1:付款 2：订单确认 3：行程中 4：完成
    var proc = 0 ; 
    switch(process)
    {
    case 1:
      proc = 10;
      break;
    case 2:
      proc = 30;
      break;
    case 3:
      proc = 50;
      break;
    case 4:
      proc = 100;
      break;
    default:
      proc = 0;
      break;
    }
    return proc;
});

Template7.registerHelper('getLocalTime', function (nS) {
    return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' '); 
});


//Template
// Templates using Template7 template engine

myApp.indexBannerTemplate = Template7.compile($$('script#IndexBanner').html());
// myApp.searchCityTemplate = Template7.compile($$('script#SearchCity').html());
myApp.indexplayItemTemplate = Template7.compile($$('script#IndexPlayItem').html());
myApp.playItemTemplate = Template7.compile($$('script#PlayItem').html());
myApp.playSelfItemTemplate = Template7.compile($$('script#PlaySelfItem').html());
myApp.selfPlayDescLineTemplate = Template7.compile($$('script#SelfPlayDescLine').html());
myApp.selfPlayDescPriceTemplate = Template7.compile($$('script#SelfPlayDescPrice').html());
// myApp.selfMenuTemplate = Template7.compile($$('script#SelfMenu').html());
myApp.selfHeadPartTemplate = Template7.compile($$('script#SelfHeadPart').html());
// myApp.editInfoTemplate = Template7.compile($$('script#EditInfo').html());
myApp.scopeListTemplate = Template7.compile($$('script#ScopeList').html());
// myApp.scopeDetailContentTemplate = Template7.compile($$('script#ScopeDetailContent').html());
// myApp.scopeDetailRemarkTemplate = Template7.compile($$('script#ScopeDetailRemark').html());
myApp.selfMsgTemplate = Template7.compile($$('script#SelfMsg').html());
// myApp.msgTemplate = Template7.compile($$('script#Msg').html());
myApp.playingmethodtypeTemplate = Template7.compile($$('script#PlayingMethodType').html());
myApp.playingMethodCityTemplate = Template7.compile($$('script#PlayingMethodCity').html());
myApp.scopeTypeTagTemplate = Template7.compile($$('script#ScopeTypeTag').html());
// myApp.selfplayingmethoddetailcontentTemplate = Template7.compile($$('script#SelfPlayingMethodDetailContent').html());
myApp.myorderlistTemplate = Template7.compile($$('script#MyOrderList').html());
myApp.myremarklist_1Template = Template7.compile($$('script#MyRemarkList_1').html());
myApp.myremarklist_2Template = Template7.compile($$('script#MyRemarkList_2').html());
myApp.orderprocess_1Template = Template7.compile($$('script#OrderProcess_1').html());
myApp.orderprocess_2Template = Template7.compile($$('script#OrderProcess_2').html());
